package com.zkh.myutils.scheduled.api;

import java.util.Date;

import javax.sql.DataSource;

import com.zkh.myutils.utils.Assert;
import com.zkh.myutils.utils.StringUtils;

/**
 * 定时任务记录列表查询参数对象
 * @author zkh
 */
public class ScheduledTaskListQueryParamBean {
	/**
	 * 任务表前缀，如果有值，则覆盖配置中的前缀
	 */
	private String taskRecordTablePre;
	/**
	 * 表前缀，用来跨库查询，拼接到表前面
	 */
	private String tablePrefix;
	/**
	 * 数据源，用来跨源查询
	 */
	private DataSource dataSource;
	
	//每页展示记录数
	private int pageSize;
	//当前页码
	private int pageIndex;
	//任务编码
	private String jobEcd;
	//任务描述
	private String jobDesc;
	//执行类型。0：自动，1：手动
	private Integer executeType;
	//执行状态。1：执行中，2：执行成功，3：执行失败
	private Integer execState;
	//开始执行时间
	private Date startTime;
	//执行结束时间
	private Date endTime;
	
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getPageIndex() {
		return pageIndex;
	}
	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}
	public String getJobEcd() {
		return jobEcd;
	}
	public void setJobEcd(String jobEcd) {
		this.jobEcd = jobEcd;
	}
	public String getJobDesc() {
		return jobDesc;
	}
	public void setJobDesc(String jobDesc) {
		this.jobDesc = jobDesc;
	}
	public Integer getExecuteType() {
		return executeType;
	}
	/**
	 * 设置执行类型<br>
	 * 执行类型代码：0：自动，1：手动
	 */
	public void setExecuteType(Integer executeType) {
		this.executeType = executeType;
	}
	/**
	 * 设置执行状态<br>
	 * 执行状态代码：1：执行中，2：执行成功，3：执行失败
	 */
	public Integer getExecState() {
		return execState;
	}
	public void setExecState(Integer execState) {
		this.execState = execState;
	}
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	public Date getEndTime() {
		return endTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	public String getTablePrefix() {
		return StringUtils.isEmpty(tablePrefix) ? "" : (tablePrefix + ".");
	}
	public void setTablePrefix(String tablePrefix) {
		this.tablePrefix = tablePrefix;
	}
	public DataSource getDataSource() {
		return dataSource;
	}
	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}
	public String getTaskRecordTablePre(String taskRecordTablePre) {
		return Assert.getOrDefault(StringUtils.isEmpty(this.taskRecordTablePre) ? taskRecordTablePre : this.taskRecordTablePre, "");
	}
	public void setTaskRecordTablePre(String taskRecordTablePre) {
		this.taskRecordTablePre = taskRecordTablePre;
	}
}
